var searchRange = function(nums, target) {
    let arr = []
    for(let i=0;i<nums.length;i++){
        if(nums[i]==target){
            arr.push(i)
        }
    }
    let start = -1
    let end = -1
    if(arr.length){
        start = arr[0]
        end = arr[length-1]
    }
    return [start,end]
}